﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<JobDescOnline.Presentation.Models.RolePrivilege>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Edit Role Member - Review JobDesc!
</asp:Content>

<asp:Content ID="Content4" ContentPlaceHolderID="SideMenu" runat="server">
    <% Html.RenderPartial("SettingMenu"); %>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2><i>Role Member</i> - Ubah Baru!</h2>

    <% Html.EnableClientValidation(); %>
    <% using (Html.BeginForm()) {%>
        <%: Html.ValidationSummary(true) %>

        <fieldset>
            <legend>Informasi Umum</legend>
            <table>
                <tr>
                    <td><%: Html.LabelFor(model => model.Role.CreatedBy)%></td>
                    <td>
                        <%: Html.TextBoxFor(model => model.Role.CreatedBy, new { @readonly = "readonly" })%>
                        <%: Html.ValidationMessageFor(model => model.Role.CreatedBy)%>
                    </td>
                    <td><%: Html.LabelFor(model => model.Role.CreatedOn)%></td>
                    <td>
                        <%: Html.TextBoxFor(model => model.Role.CreatedOn, new { @readonly = "readonly" })%>
                        <%: Html.ValidationMessageFor(model => model.Role.CreatedOn)%>
                    </td>
                </tr>
                <tr>
                    <td><%: Html.LabelFor(model => model.Role.LastModifiedBy)%></td>
                    <td>
                        <%: Html.TextBoxFor(model => model.Role.LastModifiedBy, new { @readonly = "readonly" })%>
                        <%: Html.ValidationMessageFor(model => model.Role.LastModifiedBy)%>
                    </td>
                    <td><%: Html.LabelFor(model => model.Role.LastModifiedOn)%></td>
                    <td>
                        <%: Html.TextBoxFor(model => model.Role.LastModifiedOn, new { @readonly = "readonly" })%>
                        <%: Html.ValidationMessageFor(model => model.Role.LastModifiedOn)%>
                    </td>
                </tr>
            </table>
        </fieldset>

        <fieldset>
            <legend>Data <i>Role</i></legend>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.Role.Rowstatus)%>
            </div>
            <div class="editor-field">
                <%: Html.DropDownList("Role.Rowstatus", (IEnumerable<SelectListItem>)HttpContext.Current.Application["Active"], "--Select One--")%>
                <%: Html.ValidationMessageFor(model => model.Role.Rowstatus)%>
            </div>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.Role.RoleName)%>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.Role.RoleName, new { style = "width: 300px" })%>
                <%: Html.ValidationMessageFor(model => model.Role.RoleName)%>
            </div>

            <div class="editor-label">
                <%: Html.LabelFor(model => model.Role.Description)%>
            </div>
            <div class="editor-field">
                <%: Html.TextAreaFor(model => model.Role.Description, new { style = "width: 900px" })%>
                <%: Html.ValidationMessageFor(model => model.Role.Description)%>
            </div>
        </fieldset>

        <fieldset>
            <legend><i>Privilege</i></legend>
            <table class="withborder">
                <tr>
                    <th style="width: 30px;"></th>
                    <th>Menu</th>
                    <th style="width: 70px;">Data Baru?</th>
                    <th style="width: 70px;">Ubah Data?</th>
                    <th style="width: 40px;">Hapus?</th>
                </tr>
                <% foreach (var pm in Model.PrivilegeMenu) { %>
                    <tr>
                        <td style="text-align: center"><input type="checkbox" name="id<%= pm.ID %>" <%= pm.Checked ? "checked='checked'" : "" %> /></td>
                        <td><%= pm.MenuTitle %></td>
                        <td style="text-align: center"><input type="checkbox" name="create<%= pm.ID %>" <%= pm.AllowCreate ? "checked='checked'" : "" %> /></td>
                        <td style="text-align: center"><input type="checkbox" name="update<%= pm.ID %>" <%= pm.AllowUpdate ? "checked='checked'" : "" %> /></td>
                        <td style="text-align: center"><input type="checkbox" name="delete<%= pm.ID %>" <%= pm.AllowDelete ? "checked='checked'" : "" %> /></td>
                    </tr>
                <% } %>
            </table>
        </fieldset>

        <p><input type="submit" value="Simpan" /></p>
    <% } %>

    <div><%: Html.ActionLink("Kembali", "Index") %></div>
</asp:Content>